package com.hbpu.schedule.dao.impl;

import com.hbpu.schedule.dao.BaseDao;
import com.hbpu.schedule.dao.SysScheduleDao;
import com.hbpu.schedule.pojo.SysSchedule;

import java.util.List;

public class SysScheduleDaoImpl extends BaseDao implements SysScheduleDao {
    @Override
    public int addSchedle(SysSchedule schedule) {
        String sql = "insert into sys_schedule values(default, ?, ?, ?)";
        return baseUpdate(sql, schedule.getUid(), schedule.getTitle(), schedule.getCompleted());
    }

    @Override
    public List<SysSchedule> findAllSchedle() {
        String sql = "select sid, uid, title, completed from sys_schedule";
        return baseQuery(SysSchedule.class, sql);
    }
}
